package com.hao.tool.common.enums;

import lombok.Getter;

/**
 * description
 *
 * @author RuiHaoZ on CMHK.jx
 * @date 2020-07-27 16:52
 */
@Getter
public enum StorageTypeEnum {
    TX_COS("tx_cos", "腾讯云OOS"),
    AL_COS("al_cos", "阿里云cos"),
    FTP("ftp", "ftp"),
    LOCAL("local", "本地"),

    ;
    private String code;
    private String desc;

    StorageTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static StorageTypeEnum getByCode(String code) {
        for (StorageTypeEnum value : StorageTypeEnum.values()) {
            if (value.getCode().equalsIgnoreCase(code)) {
                return value;
            }
        }
        return null;
    }
}
